home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / ImageObserver.java < prev    next >
Text File  |  1998-09-22  |  5KB  |  125 lines

  1. /*
  2.  * @(#)ImageObserver.java    1.18 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.awt.image;
  16.  
  17. import java.awt.Image;
  18.  
  19. /**
  20.  * An asynchronous update interface for receiving notifications about
  21.  * Image information as the Image is constructed.
  22.  *
  23.  * @version     1.18 07/01/98
  24.  * @author     Jim Graham
  25.  */
  26. public interface ImageObserver {
  27.     /**
  28.      * This method is called when information about an image which was
  29.      * previously requested using an asynchronous interface becomes
  30.      * available.  Asynchronous interfaces are method calls such as
  31.      * getWidth(ImageObserver) and drawImage(img, x, y, ImageObserver)
  32.      * which take an ImageObserver object as an argument.  Those methods
  33.      * register the caller as interested either in information about
  34.      * the overall image itself (in the case of getWidth(ImageObserver))
  35.      * or about an output version of an image (in the case of the
  36.      * drawImage(img, x, y, [w, h,] ImageObserver) call).  
  37.  
  38.      * <p>This method
  39.      * should return true if further updates are needed or false if the
  40.      * required information has been acquired.  The image which was being
  41.      * tracked is passed in using the img argument.  Various constants
  42.      * are combined to form the infoflags argument which indicates what
  43.      * information about the image is now available.  The interpretation
  44.      * of the x, y, width, and height arguments depends on the contents
  45.      * of the infoflags argument.
  46.      * @see Image#getWidth
  47.      * @see Image#getHeight
  48.      * @see java.awt.Graphics#drawImage
  49.      */
  50.     public boolean imageUpdate(Image img, int infoflags,
  51.                    int x, int y, int width, int height);
  52.  
  53.     /**
  54.      * The width of the base image is now available and can be taken
  55.      * from the width argument to the imageUpdate callback method.
  56.      * @see Image#getWidth
  57.      * @see #imageUpdate
  58.      */
  59.     public static final int WIDTH = 1;
  60.  
  61.     /**
  62.      * The height of the base image is now available and can be taken
  63.      * from the height argument to the imageUpdate callback method.
  64.      * @see Image#getHeight
  65.      * @see #imageUpdate
  66.      */
  67.     public static final int HEIGHT = 2;
  68.  
  69.     /**
  70.      * The properties of the image are now available.
  71.      * @see Image#getProperty
  72.      * @see #imageUpdate
  73.      */
  74.     public static final int PROPERTIES = 4;
  75.  
  76.     /**
  77.      * More pixels needed for drawing a scaled variation of the image
  78.      * are available.  The bounding box of the new pixels can be taken
  79.      * from the x, y, width, and height arguments to the imageUpdate
  80.      * callback method.
  81.      * @see java.awt.Graphics#drawImage
  82.      * @see #imageUpdate
  83.      */
  84.     public static final int SOMEBITS = 8;
  85.  
  86.     /**
  87.      * Another complete frame of a multi-frame image which was previously
  88.      * drawn is now available to be drawn again.  The x, y, width, and height
  89.      * arguments to the imageUpdate callback method should be ignored.
  90.      * @see java.awt.Graphics#drawImage
  91.      * @see #imageUpdate
  92.      */
  93.     public static final int FRAMEBITS = 16;
  94.  
  95.     /**
  96.      * A static image which was previously drawn is now complete and can
  97.      * be drawn again in its final form.  The x, y, width, and height
  98.      * arguments to the imageUpdate callback method should be ignored.
  99.      * @see java.awt.Graphics#drawImage
  100.      * @see #imageUpdate
  101.      */
  102.     public static final int ALLBITS = 32;
  103.  
  104.     /**
  105.      * An image which was being tracked asynchronously has encountered
  106.      * an error.  No further information will become available and
  107.      * drawing the image will fail.
  108.      * As a convenience, the ABORT flag will be indicated at the same
  109.      * time to indicate that the image production was aborted.
  110.      * @see #imageUpdate
  111.      */
  112.     public static final int ERROR = 64;
  113.  
  114.     /**
  115.      * An image which was being tracked asynchronously was aborted before
  116.      * production was complete.  No more information will become available
  117.      * without further action to trigger another image production sequence.
  118.      * If the ERROR flag was not also set in this image update, then
  119.      * accessing any of the data in the image will restart the production
  120.      * again, probably from the beginning.
  121.      * @see #imageUpdate
  122.      */
  123.     public static final int ABORT = 128;
  124. }
  125.